angular.module('app').controller('addPostCtrl', 
['$scope', '$rootScope', 'http',
function($scope, $rootScope,http) 
{	
	$scope.post = {isend:'1'};
	// 新增活动
	$scope.addPost = function(){
		console.log($scope.post)
		if(!angular.isObject(JSON.parse($scope.post.condition))){
			alert("开奖条件格式错误")
			return false;
		}
		if(!angular.isObject(JSON.parse($scope.post.ok))){
			alert("活动条件格式错误")
			return false;
		}
		var reqUrl = '/activity/addNewActivity';
		http.post(reqUrl, $scope.post, function(data, status){
			console.log(data, status)
			if(data.status==200){
				alert(data.msg);
			}
		})
	}

	
}]);